<?php
namespace app\admin\model;

class UserPointsLog extends \think\Model {

    public static $points_type = [1=>'现场签到', 2=>'邀请签到', 3=>'参与活动', 4=>'朋友见证', 5=>'减肥'];

    public function getTypeStrAttr($val, $data){
        return self::$points_type[$data['type']];
    }

    public function getPointsStrAttr($val, $data){
        if($data['status'] == 1){
            $add_or_sub = '+';
        }else{
            $add_or_sub = '-';
        }
        return $add_or_sub.$data['points'];
    }

}